#ifndef IMAGELOADINGTHREAD_H

#define IMAGELOADINGTHREAD_H

#include <QThread>

#include <QStringList>
#include "kinectfusion/main.h"
#include "MarkerSLAM/slam_app.h"

class ImageLoadingThread : public QThread

{

    Q_OBJECT

public:
    enum Direction
    {

        Left,

        Right

    };
    kin *pk;
    slam_app *pslam;
    ImageLoadingThread(const QStringList &imagePathList);
    std::vector<string> imgpaths;
    ~ImageLoadingThread();

    void start(ImageLoadingThread::Direction direction);

    void setOriginalImageIndex(const int imgIndex);

    ImageLoadingThread::Direction previousDirection() const { return m_CurrentDirection; }

signals:

    void image(int index, const QImage &img);

private:
    // m_ImgPathList用于保存传入的图片文件路径

    QStringList m_ImgPathList;

    int m_ImgCurrentIndex;

    Direction m_CurrentDirection;

    // 表示左边的图片离选中的图片的偏移量,初始化为1

    int m_LeftOffset;

    // 表示右边的图片离选中的图片的偏移量,初始化为1

    int m_RightOffset;

protected:
    void run(void);
};

#endif // IMAGELOADINGTHREAD_H
